<?php
defined('IN_GoogleCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);
class point_records_model extends model {
	function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'point_records';
		//$this->_username = param::get_cookie('_username');
		$this->_userid = param::get_cookie('_userid');
		parent::__construct();
	}
	

	public function add_point($cause_type,$cause_content,$userid1,$userid2,$point) {
			$point = array ();
			$point['cause_type'] = $cause_type;
			$point['cause_content'] = $cause_content;
			$point['userid1'] = $userid1;
			$point['userid2'] = $userid2;
			$point['point'] = $point;
			$point['happen_time'] = SYS_TIME;

			$id = $this->insert($point,true);
			if(!$id){
				return FALSE;
			}else {
				return true;
			}
	}
	
}
?>